/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package mnstudent.presentationlayer;

import mnstudent.global.MyTableCellRender;
import mnstudent.global.DataTable;
import mnstudent.global.Standard;
import mnstudent.businessLayer.MajorBLL;
import mnstudent.businessLayer.PriorityObjectBLL;
import mnstudent.businessLayer.PriorityObjectDetailBLL;
import mnstudent.businessLayer.RegulationBLL;
import mnstudent.businessLayer.StateBLL;
import mnstudent.businessLayer.StudentBLL;
import mnstudent.datatranferobject.MajorDTO;
import mnstudent.datatranferobject.PriorityObjectDTO;
import mnstudent.datatranferobject.PriorityObjectDetailDTO;
import mnstudent.datatranferobject.StateDTO;
import mnstudent.datatranferobject.StudentDTO;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.event.*;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author lee
 */
public class frmStudent extends javax.swing.JPanel {

    private StudentBLL m_StudentBLL;
    private PriorityObjectDetailBLL m_PriorityObjectDetailBLL;
    private RegulationBLL m_RegulationBLL;

    private int currentRow = 0;
    private DefaultTableModel m_Model;
    DefaultTableModel m_ModelPriority;
    private ArrayList<MajorDTO> arrMajorDTO;
    private ArrayList<StateDTO> arrStateDTO;
    private ArrayList<PriorityObjectDTO> arrPriorityObjectDTO, arrObjectChoosed;
    private final SimpleDateFormat formatDate= new SimpleDateFormat("dd/MM/yyyy");
    private int minAge, maxAge;
    /**
     * Creates new form frmFaculty
     */
    public frmStudent() {
        initComponents();
        initControls();
        prepare();
    }

    /**
     * CÁC PHƯƠNG THỨC THỰC HIỆN
     */
    
    /**
     * Phương thức khởi tạo tình trạng cho các controls
     */
    private void initControls()
    {
        jxTxtStudentID.setEditable(false);//luon luon false
        jxTxtFaculty.setEditable(false);
        jxTxtInputYear.setEditable(false);
        jxtabDetails.setEditable(false);
        jxTbListObject.setEditable(false);
        
         //neu chua them moi thi EditTable = false
        if(!this.jxtabDetails.m_isAdd && !this.jxtabDetails.m_isUpdate)
        {
            jxTxtNameOfStudent.setEditable(false);
            jxDpDateBirthday.setEditable(false);
            jxTxtDistrict.setEditable(false);
            jxTxtProvince.setEditable(false);
            
            jxCbGender.setEnabled(false);
            jxCbStatus.setEnabled(false);
            jxCbObject.setEnabled(false);
            jxCbMajor.setEnabled(false);
            
            jxBtnSave.setEnabled(false);
            jxBtnCancel.setEnabled(false);
            
            jxBtnAdd.setEnabled(true);
            jxBtnUpdate.setEnabled(true);
            jxBtnDelete.setEnabled(true);
        }
        else
        {
            jxTxtNameOfStudent.setEditable(true);
            jxDpDateBirthday.setEditable(true);
            jxTxtDistrict.setEditable(true);
            jxTxtProvince.setEditable(true);
            
            jxCbGender.setEnabled(true);
            jxCbStatus.setEnabled(true);
            jxCbObject.setEnabled(true);
            jxCbMajor.setEnabled(true);
            
            jxBtnSave.setEnabled(true);
            jxBtnCancel.setEnabled(true);
            

            jxBtnAdd.setEnabled(false);
            jxBtnUpdate.setEnabled(false);
            jxBtnDelete.setEnabled(false);
        }
    }
   
    /**
     * Phương thức thiết lập độ dài chuỗi nhập vào TextField
     */
    private void setMaxLenghtForTextField()
    {
         //TextField Ho ten
        jxTxtNameOfStudent.addKeyListener(new KeyAdapter() {
                public void keyTyped(KeyEvent e) {
                    int len = jxTxtNameOfStudent.getText().length();
                    if (len > Standard.MAX_LEN) {
                            e.consume();
                    }
                }
        });
        //TextField huyen
        jxTxtDistrict.addKeyListener(new KeyAdapter() {
                public void keyTyped(KeyEvent e) {
                    int len = jxTxtDistrict.getText().length();
                    if (len > Standard.MAX_LEN) {
                            e.consume();
                    }
                }
        });
        //TextField tinh/quan 
        jxTxtProvince.addKeyListener(new KeyAdapter() {
                public void keyTyped(KeyEvent e) {
                    int len = jxTxtProvince.getText().length();
                    if (len > Standard.MAX_LEN) {
                            e.consume();
                    }
                }
        });
    }
    /**
     * Phương thức chuẩn bị khởi tạo các giá trị cho frmStudent
     */
    private void prepare(){
        
        //Set lai text cac button cua dialog
        UIManager.put("OptionPane.cancelButtonText", "Hủy");
        UIManager.put("OptionPane.noButtonText", "Không");
        UIManager.put("OptionPane.okButtonText", "Vâng");
        UIManager.put("OptionPane.yesButtonText", "Có");
        setMaxLenghtForTextField();
        m_RegulationBLL = new RegulationBLL();
        minAge = Integer.valueOf(m_RegulationBLL.getRegulationByLabelToObject("TuoiToiThieuSV").getValue());
        maxAge = Integer.valueOf(m_RegulationBLL.getRegulationByLabelToObject("TuoiToiDaSV").getValue());
        
        this.m_StudentBLL = new StudentBLL ();
        this.m_PriorityObjectDetailBLL = new PriorityObjectDetailBLL();
        this.arrObjectChoosed = new ArrayList<>();
        m_Model = (DefaultTableModel)jxtabDetails.getModel();
        DataTable.addRowForStudent(m_StudentBLL.getAllInfoStudent(), m_Model);
        
        bindingDataToComboBoxs();
        bindingDataToComboBoxPriorityObject();
        //get selected item
        jxtabDetails.setDefaultRenderer(Object.class, new MyTableCellRender());
        jxtabDetails.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent lse) {
                if(!(jxtabDetails.getSelectionModel().isSelectionEmpty( )))
                {
                   //retrieving the selected row index
                    currentRow = jxtabDetails.getSelectedRow();
                    //if a single row is selected from the table, take each cell values into the controls
                    if (jxtabDetails.getRowSelectionAllowed()&&jxtabDetails.getRowCount()>0) {
                        if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
                        {
                            int rs = JOptionPane.showOptionDialog(null,
                                        "Vui lòng lưu thay đổi trước khi chuyển sang dòng khác!",
                                        "Cảnh báo",
                                        JOptionPane.YES_NO_OPTION,
                                        JOptionPane.QUESTION_MESSAGE,
                                        null,
                                        null,
                                        null);
//                            if(rs == 0 )//Yes
//                                //save();
//                            else
//                            {
//                                //cancelAction();
//                            }
                        }
                        else
                        {
                            bindingDataToControls();
                            bindingDataToComboBoxPriorityObject();
                        }
                    }
                }
            }
          });
        //neu co dl thi do mac dinh row dau tien
        if(jxtabDetails.getRowCount()>0)
        {
            jxtabDetails.setRequestFocusEnabled(true);
            jxtabDetails.requestFocus();
            jxtabDetails.changeSelection(jxtabDetails.getRowCount()-1, jxtabDetails.getRowCount()-1, false, false);
        }
    }
    
    
    /**
     * Phương thức đổ dữ liệu vào các controls có trên frmStudent
     */
    private void bindingDataToComboBoxs()
    {
        //comboBox gioi tinh(gender)
        String[] arrGender = {"Nam", "Nữ"};
        DefaultComboBoxModel dfComboBoxModelGender = new DefaultComboBoxModel(arrGender);
        jxCbGender.setModel(dfComboBoxModelGender);
        
        //comboBox Nganh(Major)
       arrMajorDTO = new ArrayList<>();
       MajorBLL _majorBLL = new MajorBLL();
       arrMajorDTO = _majorBLL.getAllMajorToArray();
       DefaultComboBoxModel dfComboBoxModelMajor = new DefaultComboBoxModel(arrMajorDTO.toArray());
       jxCbMajor.setModel(dfComboBoxModelMajor);
       
       //comboBox Trang thai
       arrStateDTO = new ArrayList<>();
       StateBLL _stateBLL = new StateBLL();
       arrStateDTO = _stateBLL.getAllStateToArray();
       DefaultComboBoxModel dfComboBoxModelState = new DefaultComboBoxModel(arrStateDTO.toArray());
       jxCbStatus.setModel(dfComboBoxModelState);
      
       if(jxtabDetails.getRowCount() == 0)
       {
           jxCbGender.setSelectedIndex(-1);
           jxCbMajor.setSelectedIndex(-1);
           jxCbObject.setSelectedIndex(-1);
           jxCbStatus.setSelectedIndex(-1);
       }
    }
    
    /**
     * Phương thức đổ dữ liệu lên comboBox đối tượng sinh viên
     */
    private void bindingDataToComboBoxPriorityObject()
    {     
       //ComboBox Doi Tuong(Object)
       if(this.jxtabDetails.m_isAdd||this.jxtabDetails.m_isUpdate)// bind du lieu len khi thuc hien them moi hoac cap nhat
       {
           if(jxCbObject.getModel().getSize()>0)
           {
               jxCbObject.removeAll();
           }
           arrPriorityObjectDTO = new ArrayList<>();
           PriorityObjectBLL arrPriorityObjectBLL = new PriorityObjectBLL();
           arrPriorityObjectDTO = arrPriorityObjectBLL.getAllPriorityObjectToArray();
           DefaultComboBoxModel dfComboBoxModelObject = new DefaultComboBoxModel(arrPriorityObjectDTO.toArray());
           jxCbObject.setModel(dfComboBoxModelObject);
       }else//luc xem du lieu co san tren JTable
       {
           if(jxCbObject.getModel().getSize()>0)
           {
               jxCbObject.removeAllItems();
           }
           String[] arrObject = {jxtabDetails.getValueAt(currentRow, 7).toString()};
           DefaultComboBoxModel dfComboBoxModelObject = new DefaultComboBoxModel(arrObject);
           jxCbObject.setModel(dfComboBoxModelObject);
       }
       
    }
   
    /**
     * Phương thức đưa dữ liệu từ JTable lên các controls trên frmStudent
     */
    private void bindingDataToControls()
    {
        jxTxtStudentID.setText(jxtabDetails.getStringAt(jxtabDetails.getSelectedRow(), 0));
        jxTxtNameOfStudent.setText(jxtabDetails.getStringAt(jxtabDetails.getSelectedRow(), 1));
        jxTxtDistrict.setText(jxtabDetails.getStringAt(jxtabDetails.getSelectedRow(), 4));
        jxTxtProvince.setText(jxtabDetails.getStringAt(jxtabDetails.getSelectedRow(), 5));

        if(!jxtabDetails.getStringAt(jxtabDetails.getSelectedRow(), 3).equals(""))
        {
            try {
                jxDpDateBirthday.setDate(formatDate.parse(jxtabDetails.getStringAt(jxtabDetails.getSelectedRow(), 3)));
            } catch (ParseException ex) {
               ex.printStackTrace();
            }
        }

        jxTxtInputYear.setText(jxtabDetails.getStringAt(jxtabDetails.getSelectedRow(), 8));
        
        //Cac comboBox
        //ComboBox gioi tinh(Gender)
        if (!jxtabDetails.getValueAt(currentRow, 2).equals("")) {
            jxCbGender.setSelectedItem(jxtabDetails.getValueAt(currentRow, 2));
        }
        //ComboBox trang thai
        if (!jxtabDetails.getValueAt(currentRow, 9).equals("")) {
            StateDTO objState = (StateDTO) jxtabDetails.getValueAt(currentRow, 9);
            jxCbStatus.setSelectedItem(objState);
        }
        //ComboBox nganh 
         if (!jxtabDetails.getValueAt(currentRow, 6).equals("")) {
            MajorDTO objMajor = (MajorDTO) jxtabDetails.getValueAt(currentRow, 6);
            jxCbMajor.setSelectedItem(objMajor);
            //Set gia tri cho jxTxtFaculty
            MajorBLL majorBLL = new MajorBLL();
            ResultSet rs = majorBLL.getNameOfFacultyByMajorIdFromDatabase(objMajor.getMajorID());
            try {
                while(rs.next())
                    jxTxtFaculty.setText(rs.getNString(1));
            } catch (SQLException ex) {
                ex.printStackTrace();
            }
        }
         //ComboBox Doi tuong
        if(!this.jxtabDetails.m_isAdd||!this.jxtabDetails.m_isUpdate){
            if(!jxtabDetails.getValueAt(currentRow, 7).equals(""))
            {
                ArrayList<PriorityObjectDTO> arrPriorityObject =  m_StudentBLL.getListPriorityObjectOfStudent(jxTxtStudentID.getText().trim());
                initJTableForPriorityObject(arrPriorityObject);
            }
        }
    }
    
    /**
     * Phương thức thiết lập giá trị cho JTable chứa danh sách các đối tượng của sinh viên hiện tại
     * @param _arrPriorityObject: danh sách đối tượng của sinh viên hiện tại
     */
    private void initJTableForPriorityObject(ArrayList<PriorityObjectDTO> _arrPriorityObject)
    {

        m_ModelPriority = (DefaultTableModel) jxTbListObject.getModel();
        m_ModelPriority.fireTableDataChanged();
        m_ModelPriority.fireTableStructureChanged();
        if(_arrPriorityObject.size()>0){
        m_ModelPriority.getDataVector().removeAllElements();
        
        for(PriorityObjectDTO obj : _arrPriorityObject)
        {
            Vector _row = new Vector(); 
            _row.addElement(obj.getPriorityObjectID());
            _row.addElement(obj.getNameOfObject());
            m_ModelPriority.addRow(_row);     
        }
        }
        else
        {
            m_ModelPriority.removeRow(0);
        }
        jxTbListObject.setDefaultRenderer(Object.class, new MyTableCellRender());

    }
    
    /**
     * Phương thức khởi gán lại giá trị cho các controls
     * @param _idStudent: mssv hiện tại
     * @param _inputYear: năm nhập học của sinh viên hiện tại
     */
    private void resetControls(String _idStudent, String _inputYear)
    {
        jxTxtStudentID.setText(_idStudent);
        jxTxtInputYear.setText(_inputYear);
        jxTxtFaculty.setText("");
        
        //xoa het cac dong co trne bang chua ds doi tuong
        jxTxtNameOfStudent.setText("");
        jxTxtNameOfStudent.requestFocus();
        jxDpDateBirthday.setDate(null);
        jxTxtDistrict.setText("");
        jxTxtProvince.setText("");

        jxCbGender.setSelectedItem(null);
        jxCbStatus.setSelectedItem(null);
        jxCbObject.setSelectedItem(null);
        jxCbMajor.setSelectedItem(null);
    }
    
    /**
     * Phương thức refresh lại dữ liệu trên JTable
     */
    private void refreshDataInJTable() {
        m_Model.fireTableDataChanged();
        m_Model.fireTableStructureChanged();
        m_Model.getDataVector().removeAllElements();
        DataTable.addRowForStudent(m_StudentBLL.getAllInfoStudent(), m_Model);
        if (jxtabDetails.getRowCount() > 0) {
            jxtabDetails.setRequestFocusEnabled(true);
            jxtabDetails.requestFocus();
            jxtabDetails.changeSelection(jxtabDetails.getRowCount() - 1, jxtabDetails.getRowCount() - 1, false, false);
        }
    }
    
    /**
     * Phương thức tạo đối tượng sinh viên
     * @return 
     */
    private StudentDTO initObjectStudentDTO()
    {
        java.sql.Date d = new java.sql.Date(jxDpDateBirthday.getDate().getYear(), jxDpDateBirthday.getDate().getMonth(),jxDpDateBirthday.getDate().getDate());   
        //tao obj sinh vien
        StudentDTO student = new StudentDTO();
        student.setStudentID(jxTxtStudentID.getText().trim());
        student.setFullName(Standard.standardNamePerson(jxTxtNameOfStudent.getText().trim()));
        student.setGender(jxCbGender.getSelectedItem().toString().trim());
        student.setDayOfBirth(d);
        student.setDistrict(Standard.standardNamePerson(jxTxtDistrict.getText().trim()));
        student.setProvince(Standard.standardNamePerson(jxTxtProvince.getText().trim()));
        student.setAdmissionYear(Integer.parseInt(jxTxtInputYear.getText().trim()));
        MajorDTO major = (MajorDTO)jxCbMajor.getSelectedItem();
        student.setMajorID(major.getMajorID());
        StateDTO statusObj = (StateDTO)jxCbStatus.getSelectedItem();
        student.setStateID(statusObj.getStateID());
        student.setM_ListPriorityObject(arrObjectChoosed);

        return student;
    }
     
    /**
     * Phương thức lưu chi tiết đối tượng xuống database
     * @return 
     */
    private boolean isSaveDetailPriortySubject(StudentDTO student)
    {
        boolean rs = false;
        if(student.getM_ListPriorityObject().size() == 1){
           PriorityObjectDetailDTO subPriorityObj = new PriorityObjectDetailDTO(student.getStudentID(),student.getM_ListPriorityObject().get(0).getPriorityObjectID().trim());
           if(m_PriorityObjectDetailBLL.insertPrioritySubDetail(subPriorityObj))
               rs = true;
        }
        else
        { 
            ArrayList<PriorityObjectDetailDTO> arr = new ArrayList<PriorityObjectDetailDTO>();
            for(PriorityObjectDTO i : student.getM_ListPriorityObject())
            {
                arr.add(new PriorityObjectDetailDTO(student.getStudentID(),i.getPriorityObjectID()));
            }
            if(m_PriorityObjectDetailBLL.insertArrayPrioritySubDetail(arr))
               rs = true;
        }
        return rs;
    }
    /**
     * Phương thức thuc hien insert Sinh viên xuong database
     * @return 
     */
    private void saveToDatabae()
    {
        if(checkData())
        {    
            StudentDTO studentObj = initObjectStudentDTO();
            //insert 
            if(m_StudentBLL.insertStudentToDatabase(studentObj)){
               if(isSaveDetailPriortySubject(studentObj))
               {
                   JOptionPane.showOptionDialog(null, 
                        "Lưu xuống thành công!", 
                        "Thông báo", 
                        JOptionPane.YES_OPTION,
                        JOptionPane.QUESTION_MESSAGE,
                        null,
                        null,
                        null);
                        //neu Cập nhật thanh cong
                       this.jxtabDetails.m_isAdd = false;
                       initControls();
                       refreshDataInJTable();
                       arrObjectChoosed.clear();
                    }
                    else
                    {
                         JOptionPane.showMessageDialog(null,"Lưu xuống thất bại. Vui lòng kiểm tra lại!", "Lỗi", JOptionPane.YES_OPTION);
                    } 
               }
        }
    }
    
    /**
     * Phương thức thuc hien cap nhat Sinh viên xuống database
     * @return true:thành công, false: thất bại
     */
    private void updateToDatabase()
    {
        if(checkData())
        {    
            StudentDTO studentObj = initObjectStudentDTO();
            //update
            if(m_StudentBLL.updateStudentToDatabase(studentObj)){
                //Tien hanh xoa trong CT_DOITUONG
                if(m_PriorityObjectDetailBLL.deletePrioritySubDetailFromDatabase(studentObj.getStudentID()))
                {
                     //Insert lai vao CT_DOITUONG
                    if(isSaveDetailPriortySubject(studentObj))
                    {
                        JOptionPane.showOptionDialog(null, 
                        "Câp nhật thành công!", 
                        "Thông báo", 
                        JOptionPane.YES_OPTION,
                        JOptionPane.QUESTION_MESSAGE,
                        null,
                        null,
                        null);
                        //neu Cập nhật thanh cong
                       this.jxtabDetails.m_isUpdate = false;
                       initControls();
                       refreshDataInJTable();
                       arrObjectChoosed.clear();
                    }
                    else
                    {
                         JOptionPane.showMessageDialog(null, "Câp nhật thất bại. Vui lòng kiểm tra lại!", "Lỗi", JOptionPane.YES_OPTION);
                    }
                }
            }
        }
    }
 
     /**
     * Phương thức xoa 1 khoa dc chon
     * @param rowSelected
     * @return 
     */
     private boolean isDelete(int rowSelected)
    {
        boolean m_isDelete = false;

        String id = this.jxtabDetails.getValueAt(rowSelected, 0).toString();
        String name = this.jxtabDetails.getValueAt(rowSelected, 1).toString();
        StudentDTO studentObj = new StudentDTO();
        studentObj.setStudentID(id);
        studentObj.setFullName(name);
        
        if(m_PriorityObjectDetailBLL.deletePrioritySubDetailFromDatabase(studentObj.getStudentID()))
        {
           if(m_StudentBLL.deleteStudentFromDatabase(studentObj)){
               m_Model.removeRow(rowSelected);
                m_isDelete = true;
            }
        }
        return m_isDelete;
    }
    
    /**
      * Phương thức xoa 1 luc nhieu khoa
      * @return 
      */
    private boolean isDeleteMoreStudent()
    {
        boolean m_isDelete = true;
        int[] arrRowSelected = this.jxtabDetails.getSelectedRows();
        for(int i = arrRowSelected.length - 1; i >=0; i--)
        {
            if(!isDelete(arrRowSelected[i])){
                JOptionPane.showMessageDialog(null, 
                        "Xóa thất bại sinh viên: "+ jxtabDetails.getValueAt(arrRowSelected[i], 1) , 
                        "Lỗi", 
                        JOptionPane.YES_OPTION);
                m_isDelete = false;
            }
        }
        return m_isDelete;
    }
    
    /**
     * Phương thức thuc hien viec cap nhat va update
     */
    private void save()
    {
         if(this.jxtabDetails.m_isAdd)
        {
            saveToDatabae();
        }
        else
            if(this.jxtabDetails.m_isUpdate)
            {
                updateToDatabase();
                  
            }
    }
    
    /**
     * Phương thức thiết lập lại giá trị, tình trạng cho các controls, 
     * khi hủy các thao tác.
     */
    private void cancelAction() {
        if (this.jxtabDetails.m_isAdd) {
            ((DefaultTableModel) jxtabDetails.getModel()).removeRow(jxtabDetails.getRowCount() - 1);
            this.jxtabDetails.m_isAdd = false;
            initControls();
            jxTxtStudentID.setText("");
            jxTxtNameOfStudent.setText("");
            jxtabDetails.changeSelection(jxtabDetails.getRowCount() - 1, jxtabDetails.getRowCount() - 1, false, false);

        } else {
            this.jxtabDetails.m_isUpdate = false;
            initControls();

        }
        refreshDataInJTable();
        arrObjectChoosed.clear();
    }
    
    /**
     * Phương thức kiem tra xem du lieu tren co bi bo trong hay ko?
     * @return true: ko bo trong, false: co du lieu trong
     */
    private boolean checkData()
    {
        if(jxTxtStudentID.getText().equals("")||
                jxTxtNameOfStudent.getText().equals("")||
                jxTxtDistrict.getText().equals("")||
                jxTxtProvince.getText().equals("")||
                jxTxtFaculty.getText().equals("")||
                jxTxtInputYear.getText().equals("")||
                jxCbGender.getSelectedIndex()== -1||
                jxCbMajor.getSelectedIndex()== -1||
                jxCbObject.getSelectedIndex()== -1||
                jxDpDateBirthday.getDate().equals(null)||
                jxCbStatus.getSelectedIndex()== -1||
                arrObjectChoosed.isEmpty()){
            JOptionPane.showOptionDialog(null,
                    "Dữ liệu không được bỏ trống. Vui lòng nhập lại!", 
                    "Cảnh báo",
                    JOptionPane.YES_OPTION,
                    JOptionPane.WARNING_MESSAGE,
                    null,
                    null,
                    null);
            return false;
        }
        else
        {
            if(Standard.compareDate(jxDpDateBirthday.getDate(), Standard.getDateSystem()) == 1||Standard.compareDate(jxDpDateBirthday.getDate(), Standard.getDateSystem()) == 0){//ngay sinh phai nho hon hoac bang ngay hien tai
                int age = Standard.calculateAge(jxDpDateBirthday.getDate());
                if (age >= minAge && age <= maxAge) {
                    return true;
                } else {
                    JOptionPane.showMessageDialog(null, "Tuổi sinh viên không hợp lệ!");
                    return false;
                }
            }
            else
            {
                 JOptionPane.showMessageDialog(null, "Ngày sinh phải nhỏ hơn hoặc bằng ngày hiện tại!");
                    return false;
            }
        }
      
    }
    
    /**
     * Phương thức hien len showDialog chon nam nhap hoc khi them moi sinh vien
     * @param yearStart
     * @return Chuoi nam nhap hoc can chon
     */
     public String createDialogInputYear(int yearStart)
    {
        int currentYear = Standard.getDateSystem().getYear()+1900;
        String[] arrInputYear = new String[currentYear - yearStart+1];
        int yearTemp = 2014;
        for(int i = 0; i <= currentYear - yearStart; i++)
        {
            arrInputYear[i] = String.valueOf(yearTemp);
            yearTemp--;
        }
        
        String temp = (String) JOptionPane.showInputDialog(null,
                    "Vui lòng chọn năm nhập học của sinh viên",
                    "Năm nhập học", 
                    JOptionPane.INFORMATION_MESSAGE, 
                    null, 
                    arrInputYear,
                    String.valueOf(currentYear));
        return temp;
    }
     
     /**
      * CODE MẶC ĐỊNH
      */
     
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jxpanDetails = new org.jdesktop.swingx.JXPanel();
        jpanTableDetails = new javax.swing.JPanel();
        jpanContent = new javax.swing.JPanel();
        jxpanFindNavibar = new org.jdesktop.swingx.JXPanel();
        jpanChose = new javax.swing.JPanel();
        jChkSearchWithMajorID = new javax.swing.JCheckBox();
        jChkSearchWithMajorName = new javax.swing.JCheckBox();
        jChkSearchFast = new javax.swing.JCheckBox();
        jChkSearchWithFacultyName = new javax.swing.JCheckBox();
        jChkSearchWithFacultyName1 = new javax.swing.JCheckBox();
        jChkSearchWithFacultyName2 = new javax.swing.JCheckBox();
        jChkSearchWithFacultyName3 = new javax.swing.JCheckBox();
        jxbtnFindVisible = new org.jdesktop.swingx.JXButton();
        jxSearchFaculty = new org.jdesktop.swingx.JXSearchField();
        jXLabel1 = new org.jdesktop.swingx.JXLabel();
        jScrollPane = new javax.swing.JScrollPane();
        jxtabDetails = new mnstudent.global.MyTable();
        jpanFuntionalDetails = new javax.swing.JPanel();
        jxBtnAdd = new org.jdesktop.swingx.JXButton();
        jxBtnUpdate = new org.jdesktop.swingx.JXButton();
        jxBtnDelete = new org.jdesktop.swingx.JXButton();
        jxBtnSave = new org.jdesktop.swingx.JXButton();
        jxBtnCancel = new org.jdesktop.swingx.JXButton();
        jxpanHeader = new org.jdesktop.swingx.JXPanel();
        jxpanTitleHeader = new org.jdesktop.swingx.JXPanel();
        jXLabel5 = new org.jdesktop.swingx.JXLabel();
        jxpanInfoHeader = new org.jdesktop.swingx.JXPanel();
        jxpanInfo = new org.jdesktop.swingx.JXPanel();
        jxLabFacultyID = new org.jdesktop.swingx.JXLabel();
        jxTxtStudentID = new org.jdesktop.swingx.JXTextField();
        jxLabNameOfFaculty = new org.jdesktop.swingx.JXLabel();
        jxTxtNameOfStudent = new org.jdesktop.swingx.JXTextField();
        jxTxtDistrict = new org.jdesktop.swingx.JXTextField();
        jxTxtInputYear = new org.jdesktop.swingx.JXTextField();
        jXLabel11 = new org.jdesktop.swingx.JXLabel();
        jXLabel8 = new org.jdesktop.swingx.JXLabel();
        jxCbGender = new org.jdesktop.swingx.JXComboBox();
        jXLabel4 = new org.jdesktop.swingx.JXLabel();
        jXLabel3 = new org.jdesktop.swingx.JXLabel();
        jxDpDateBirthday = new org.jdesktop.swingx.JXDatePicker();
        jLblNamNhapHoc = new org.jdesktop.swingx.JXLabel();
        jXLabel7 = new org.jdesktop.swingx.JXLabel();
        jXLabel10 = new org.jdesktop.swingx.JXLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jxTbListObject = new mnstudent.global.MyTable();
        jxCbMajor = new org.jdesktop.swingx.JXComboBox();
        jxCbObject = new org.jdesktop.swingx.JXComboBox();
        jxTxtProvince = new org.jdesktop.swingx.JXTextField();
        jXLabel13 = new org.jdesktop.swingx.JXLabel();
        jxCbStatus = new org.jdesktop.swingx.JXComboBox();
        jxTxtFaculty = new org.jdesktop.swingx.JXTextField();
        jXLabel14 = new org.jdesktop.swingx.JXLabel();

        setLayout(new java.awt.BorderLayout());

        jxpanDetails.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jxpanDetails.setLayout(new java.awt.BorderLayout());

        jpanTableDetails.setLayout(new java.awt.BorderLayout());

        jpanContent.setLayout(new java.awt.BorderLayout());

        jxpanFindNavibar.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jxpanFindNavibar.setPreferredSize(new java.awt.Dimension(914, 30));

        jpanChose.setBorder(javax.swing.BorderFactory.createTitledBorder("Chọn nội dung tìm kiếm"));

        jChkSearchWithMajorID.setText("Tìm theo MSSV");

        jChkSearchWithMajorName.setText("Tìm theo họ & tên");

        jChkSearchFast.setText("Tìm kiếm nhanh");

        jChkSearchWithFacultyName.setText("Tìm theo ngành");

        jChkSearchWithFacultyName1.setText("Tìm theo năm nhập học");

        jChkSearchWithFacultyName2.setText("Tìm theo trạng thái");

        jChkSearchWithFacultyName3.setText("Tìm theo đối tượng");

        javax.swing.GroupLayout jpanChoseLayout = new javax.swing.GroupLayout(jpanChose);
        jpanChose.setLayout(jpanChoseLayout);
        jpanChoseLayout.setHorizontalGroup(
            jpanChoseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanChoseLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jChkSearchWithMajorID)
                .addGap(18, 18, 18)
                .addComponent(jChkSearchWithMajorName)
                .addGap(18, 18, 18)
                .addComponent(jChkSearchWithFacultyName)
                .addGap(18, 18, 18)
                .addComponent(jChkSearchWithFacultyName1)
                .addGap(18, 18, 18)
                .addComponent(jChkSearchWithFacultyName3)
                .addGap(18, 18, 18)
                .addComponent(jChkSearchWithFacultyName2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 204, Short.MAX_VALUE)
                .addComponent(jChkSearchFast)
                .addContainerGap())
        );
        jpanChoseLayout.setVerticalGroup(
            jpanChoseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanChoseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jChkSearchWithMajorID)
                .addComponent(jChkSearchFast)
                .addComponent(jChkSearchWithFacultyName)
                .addComponent(jChkSearchWithMajorName)
                .addComponent(jChkSearchWithFacultyName1)
                .addComponent(jChkSearchWithFacultyName2)
                .addComponent(jChkSearchWithFacultyName3))
        );

        jxbtnFindVisible.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jxbtnFindVisible.setText("Tùy chọn");
        jxbtnFindVisible.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxbtnFindVisibleActionPerformed(evt);
            }
        });

        jXLabel1.setText("Tìm kiếm:");

        javax.swing.GroupLayout jxpanFindNavibarLayout = new javax.swing.GroupLayout(jxpanFindNavibar);
        jxpanFindNavibar.setLayout(jxpanFindNavibarLayout);
        jxpanFindNavibarLayout.setHorizontalGroup(
            jxpanFindNavibarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jxpanFindNavibarLayout.createSequentialGroup()
                .addComponent(jxbtnFindVisible, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jXLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jxSearchFaculty, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jpanChose, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jxpanFindNavibarLayout.setVerticalGroup(
            jxpanFindNavibarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jxpanFindNavibarLayout.createSequentialGroup()
                .addGroup(jxpanFindNavibarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jxbtnFindVisible, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jxSearchFaculty, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jpanChose, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jpanContent.add(jxpanFindNavibar, java.awt.BorderLayout.PAGE_START);

        jxtabDetails.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Mã số sinh viên", "Họ & tên", "Giới tính", "Ngày sinh", "Quận/Huyện", "Tỉnh/Tp", "Ngành", "Đối tượng", "Năm nhập học", "Trạng thái"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.String.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, true, true, true, true, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jxtabDetails.setEditable(false);
        jxtabDetails.setSelectionBackground(new java.awt.Color(153, 153, 153));
        jScrollPane.setViewportView(jxtabDetails);

        jpanContent.add(jScrollPane, java.awt.BorderLayout.CENTER);

        jpanTableDetails.add(jpanContent, java.awt.BorderLayout.CENTER);

        jpanFuntionalDetails.setLayout(new java.awt.GridBagLayout());

        jxBtnAdd.setText("Thêm mới");
        jxBtnAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxBtnAddActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.ipadx = 20;
        gridBagConstraints.ipady = 6;
        gridBagConstraints.insets = new java.awt.Insets(8, 10, 6, 9);
        jpanFuntionalDetails.add(jxBtnAdd, gridBagConstraints);

        jxBtnUpdate.setText("Sửa đổi");
        jxBtnUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxBtnUpdateActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.ipadx = 20;
        gridBagConstraints.ipady = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
        gridBagConstraints.insets = new java.awt.Insets(8, 10, 6, 8);
        jpanFuntionalDetails.add(jxBtnUpdate, gridBagConstraints);

        jxBtnDelete.setText("Xóa bỏ");
        jxBtnDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxBtnDeleteActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.ipadx = 20;
        gridBagConstraints.ipady = 6;
        gridBagConstraints.insets = new java.awt.Insets(10, 10, 4, 8);
        jpanFuntionalDetails.add(jxBtnDelete, gridBagConstraints);

        jxBtnSave.setText("Lưu xuống");
        jxBtnSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxBtnSaveActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.ipadx = 20;
        gridBagConstraints.ipady = 6;
        gridBagConstraints.insets = new java.awt.Insets(11, 9, 7, 8);
        jpanFuntionalDetails.add(jxBtnSave, gridBagConstraints);

        jxBtnCancel.setText("Hủy bỏ");
        jxBtnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxBtnCancelActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.ipadx = 20;
        gridBagConstraints.ipady = 6;
        gridBagConstraints.insets = new java.awt.Insets(12, 9, 8, 9);
        jpanFuntionalDetails.add(jxBtnCancel, gridBagConstraints);

        jpanTableDetails.add(jpanFuntionalDetails, java.awt.BorderLayout.EAST);

        jxpanDetails.add(jpanTableDetails, java.awt.BorderLayout.CENTER);

        add(jxpanDetails, java.awt.BorderLayout.CENTER);

        jxpanHeader.setLayout(new java.awt.BorderLayout());

        jxpanTitleHeader.setBorder(new org.jdesktop.swingx.border.DropShadowBorder());

        jXLabel5.setForeground(new java.awt.Color(0, 102, 255));
        jXLabel5.setText("SINH VIÊN");
        jXLabel5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
        jxpanTitleHeader.add(jXLabel5);

        jxpanHeader.add(jxpanTitleHeader, java.awt.BorderLayout.PAGE_START);

        jxpanInfoHeader.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jxpanInfoHeader.setLayout(new java.awt.BorderLayout());

        jxpanInfo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "THÔNG TIN", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));

        jxLabFacultyID.setText("Mã số sinh viên");

        jxTxtStudentID.addCaretListener(new javax.swing.event.CaretListener() {
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                jxTxtStudentIDCaretUpdate(evt);
            }
        });

        jxLabNameOfFaculty.setText("Họ & tên");

        jxTxtNameOfStudent.addCaretListener(new javax.swing.event.CaretListener() {
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                jxTxtNameOfStudentCaretUpdate(evt);
            }
        });

        jxTxtDistrict.addCaretListener(new javax.swing.event.CaretListener() {
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                jxTxtDistrictCaretUpdate(evt);
            }
        });

        jxTxtInputYear.addCaretListener(new javax.swing.event.CaretListener() {
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                jxTxtInputYearCaretUpdate(evt);
            }
        });

        jXLabel11.setText("Tỉnh/TP");

        jXLabel8.setText("Giới tính");

        jxCbGender.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxCbGenderActionPerformed(evt);
            }
        });

        jXLabel4.setText("Ngành");

        jXLabel3.setText("Ngày sinh");

        jxDpDateBirthday.setFormats("dd/MM/yyyy");
        jxDpDateBirthday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxDpDateBirthdayActionPerformed(evt);
            }
        });

        jLblNamNhapHoc.setText("Năm nhập học:");

        jXLabel7.setText("Quận/Huyện");

        jXLabel10.setText("Đối tượng");

        jxTbListObject.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Mã đối tượng", "Tên đối tượng"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jxTbListObject);

        jxCbMajor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxCbMajorActionPerformed(evt);
            }
        });

        jxCbObject.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxCbObjectActionPerformed(evt);
            }
        });

        jxTxtProvince.addCaretListener(new javax.swing.event.CaretListener() {
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                jxTxtProvinceCaretUpdate(evt);
            }
        });

        jXLabel13.setText("Trạng thái");

        jxCbStatus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jxCbStatusActionPerformed(evt);
            }
        });

        jXLabel14.setText("Khoa");

        javax.swing.GroupLayout jxpanInfoLayout = new javax.swing.GroupLayout(jxpanInfo);
        jxpanInfo.setLayout(jxpanInfoLayout);
        jxpanInfoLayout.setHorizontalGroup(
            jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jxpanInfoLayout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jxLabFacultyID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblNamNhapHoc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jxTxtStudentID, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)
                    .addComponent(jxTxtDistrict, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)
                    .addComponent(jxCbGender, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jxDpDateBirthday, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jxTxtInputYear, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(55, 55, 55)
                .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jXLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jxLabNameOfFaculty, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jXLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jXLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jXLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jxTxtFaculty, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jxTxtProvince, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jxCbMajor, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
                    .addComponent(jxTxtNameOfStudent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jxpanInfoLayout.createSequentialGroup()
                        .addComponent(jxCbStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addGap(55, 55, 55)
                .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jxpanInfoLayout.createSequentialGroup()
                        .addComponent(jXLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jxCbObject, javax.swing.GroupLayout.PREFERRED_SIZE, 334, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 409, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0))
        );
        jxpanInfoLayout.setVerticalGroup(
            jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jxpanInfoLayout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jxLabFacultyID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jxTxtStudentID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jxLabNameOfFaculty, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jxTxtNameOfStudent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jxCbObject, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jxpanInfoLayout.createSequentialGroup()
                        .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jxDpDateBirthday, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jxCbMajor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jxCbGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jxTxtFaculty, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jxTxtDistrict, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jxTxtProvince, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jxpanInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jxTxtInputYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLblNamNhapHoc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jxCbStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 5, Short.MAX_VALUE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addGap(0, 0, 0))
        );

        jxpanInfoHeader.add(jxpanInfo, java.awt.BorderLayout.CENTER);
        jxpanInfo.getAccessibleContext().setAccessibleName("THÔNG TIN SINH VIÊN");

        jxpanHeader.add(jxpanInfoHeader, java.awt.BorderLayout.CENTER);

        add(jxpanHeader, java.awt.BorderLayout.NORTH);
    }// </editor-fold>//GEN-END:initComponents

     /**
     * CÁC EVENT
     * @param evt 
     */
    
    private void jxbtnFindVisibleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxbtnFindVisibleActionPerformed
        if(jxbtnFindVisible.getText().equals("Đóng"))
        {
          jxbtnFindVisible.setPreferredSize(new Dimension(110,25));
          jxbtnFindVisible.setText("Tùy chọn");
          jxbtnFindVisible.revalidate();
          jxpanFindNavibar.setPreferredSize(new Dimension(30, 30));
          jxpanFindNavibar.revalidate();
        }
        else
        {
            jxbtnFindVisible.setPreferredSize(new Dimension(20, 25));
            jxbtnFindVisible.setText("Đóng");
            jxbtnFindVisible.revalidate();
            jxpanFindNavibar.setPreferredSize(new Dimension(30, 105));
            jxpanFindNavibar.revalidate();
        }
    }//GEN-LAST:event_jxbtnFindVisibleActionPerformed

    private void jxBtnAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxBtnAddActionPerformed

        int inputYear = 0;
        String strInputYear = createDialogInputYear(2000);
        if(strInputYear != null && Standard.isNumber(strInputYear))
        {
            inputYear = Integer.valueOf(strInputYear);
            if(inputYear > 1900 && inputYear <= (Standard.getDateSystem().getYear()+1900))
            {
                for (int i = 0; i < jxtabDetails.getColumnCount(); i++) {
                    if(jxtabDetails.getValueAt(jxtabDetails.getRowCount()-1, i).equals(""))
                        return;
                }

                Vector newRow = new Vector(jxtabDetails.getColumnCount());
                for (int i = 0; i < jxtabDetails.getColumnCount(); i++) {
                    newRow.addElement("");
                }
                ((DefaultTableModel)jxtabDetails.getModel()).addRow(newRow);
                jxtabDetails.setRowSelectionInterval(jxtabDetails.getRowCount()-1,jxtabDetails.getRowCount()-1);
                //jxtabDetails.setEnabled(false);
                //jxtabDetails.setRowSelectionAllowed(false);
                JScrollBar sb = jScrollPane.getVerticalScrollBar();
                sb.setValue( sb.getMaximum());

                if(!this.jxtabDetails.m_isAdd){     
                   this.jxtabDetails.m_isAdd = true;
                   initControls();
                   this.jxtabDetails.m_rowIndex = jxtabDetails.getRowCount()-1;

                   //xoa sach du lieu tren JTable ds Doi tuong
                   DefaultTableModel _model = (DefaultTableModel) this.jxTbListObject.getModel();
                   for(int i = _model.getRowCount() - 1; i>=0;i--)
                       _model.removeRow(i);
                   bindingDataToComboBoxPriorityObject();
                   String _idStudent = m_StudentBLL.initStudentID(String.valueOf(inputYear), 
                            m_StudentBLL.getStudentIdMaxFromDatabase(String.valueOf(inputYear)));
                   resetControls( _idStudent, strInputYear);
        }
            }
        }
    }//GEN-LAST:event_jxBtnAddActionPerformed

    private void jxTxtStudentIDCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jxTxtStudentIDCaretUpdate

       if(this.jxtabDetails.m_isAdd)
            jxtabDetails.getModel().setValueAt(jxTxtStudentID.getText(), jxtabDetails.getRowCount()-1, 0);
       else
           if(this.jxtabDetails.m_isUpdate)
               jxtabDetails.getModel().setValueAt(jxTxtStudentID.getText(), jxtabDetails.getSelectedRow(), 0);
    }//GEN-LAST:event_jxTxtStudentIDCaretUpdate

    private void jxTxtNameOfStudentCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jxTxtNameOfStudentCaretUpdate

        if(this.jxtabDetails.m_isAdd)
            jxtabDetails.getModel().setValueAt(jxTxtNameOfStudent.getText(), jxtabDetails.getRowCount()-1, 1);
        else
            if(this.jxtabDetails.m_isUpdate)
                jxtabDetails.getModel().setValueAt(jxTxtNameOfStudent.getText(), jxtabDetails.getSelectedRow(), 1);
    }//GEN-LAST:event_jxTxtNameOfStudentCaretUpdate

    private void jxCbObjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxCbObjectActionPerformed
       if(jxCbObject.getSelectedItem() != null){
            if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
            {
                PriorityObjectDTO obj = (PriorityObjectDTO)jxCbObject.getSelectedItem();
                if(obj != null){
                    if(!arrObjectChoosed.contains(obj))
                        arrObjectChoosed.add(obj);
                    else
                        arrObjectChoosed.remove(obj);

                    initJTableForPriorityObject(arrObjectChoosed);
                    jxtabDetails.getModel().setValueAt(Standard.getToStringOfArray(arrObjectChoosed), jxtabDetails.getSelectedRow(), 7);
                }
            }
       }
    }//GEN-LAST:event_jxCbObjectActionPerformed

    private void jxCbGenderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxCbGenderActionPerformed
        if(jxCbGender.getSelectedItem() != null){
            if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
            {
                String gender = jxCbGender.getSelectedItem().toString();
                jxtabDetails.getModel().setValueAt(gender, jxtabDetails.getSelectedRow(), 2);
            }
        }
    }//GEN-LAST:event_jxCbGenderActionPerformed

    private void jxCbMajorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxCbMajorActionPerformed

        if(jxCbMajor.getSelectedItem() != null){
            if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
            {
                try {
                    MajorDTO major = (MajorDTO)jxCbMajor.getSelectedItem();
                    jxtabDetails.getModel().setValueAt(major.toString(), jxtabDetails.getSelectedRow(), 6);

                    //Set gia tri cho jxTxtFaculty
                    MajorBLL majorBLL = new MajorBLL();
                    ResultSet rs = majorBLL.getNameOfFacultyByMajorIdFromDatabase(major.getMajorID());
                    while(rs.next())
                        jxTxtFaculty.setText(rs.getNString(1));
                } catch (SQLException ex) {
                   ex.printStackTrace();
                }
            }     
        }
    }//GEN-LAST:event_jxCbMajorActionPerformed

    private void jxCbStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxCbStatusActionPerformed
        
        if(jxCbStatus.getSelectedItem() != null){
            if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
            {
                String status = jxCbStatus.getSelectedItem().toString();
                jxtabDetails.getModel().setValueAt(status, jxtabDetails.getSelectedRow(), 9);
            }
        }
    }//GEN-LAST:event_jxCbStatusActionPerformed

    private void jxDpDateBirthdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxDpDateBirthdayActionPerformed
        if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
        {
            String date = formatDate.format(jxDpDateBirthday.getDate());
            jxtabDetails.getModel().setValueAt(date, jxtabDetails.getSelectedRow(), 3);
        }
           
    }//GEN-LAST:event_jxDpDateBirthdayActionPerformed

    private String homeLess = "";
    private void jxTxtDistrictCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jxTxtDistrictCaretUpdate
        if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
        {
            String district = jxTxtDistrict.getText();
            jxtabDetails.getModel().setValueAt(district, jxtabDetails.getSelectedRow(), 4);
        }
    }//GEN-LAST:event_jxTxtDistrictCaretUpdate

    private void jxTxtProvinceCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jxTxtProvinceCaretUpdate
       if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
        {
            String province = jxTxtProvince.getText();
            jxtabDetails.getModel().setValueAt(province, jxtabDetails.getSelectedRow(), 5);
        }
    }//GEN-LAST:event_jxTxtProvinceCaretUpdate

    private void jxTxtInputYearCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jxTxtInputYearCaretUpdate
       if(jxtabDetails.m_isAdd||jxtabDetails.m_isUpdate)
        {
            String inputYear = jxTxtInputYear.getText();
            jxtabDetails.getModel().setValueAt(inputYear, jxtabDetails.getSelectedRow(), 8);
        }
    }//GEN-LAST:event_jxTxtInputYearCaretUpdate

    private void jxBtnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxBtnCancelActionPerformed
        cancelAction();
    }//GEN-LAST:event_jxBtnCancelActionPerformed

    private void jxBtnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxBtnSaveActionPerformed
      
        save();
    }//GEN-LAST:event_jxBtnSaveActionPerformed

    private void jxBtnUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxBtnUpdateActionPerformed
      
        this.jxtabDetails.m_isUpdate = true;   
        bindingDataToComboBoxPriorityObject();
        initControls();
        jxTxtNameOfStudent.requestFocus();
        
       for(int i = 0; i<jxTbListObject.getRowCount(); i++)
        {
            for(PriorityObjectDTO obj : arrPriorityObjectDTO)
            {
                if(obj.getPriorityObjectID().equals(jxTbListObject.getValueAt(i, 0).toString())){
                    arrObjectChoosed.add(obj);
                } 
            }
        }
         //xoa sach du lieu tren JTable ds Doi tuong
       DefaultTableModel _model = (DefaultTableModel) this.jxTbListObject.getModel();
       for(int i = _model.getRowCount() - 1; i>=0;i--)
           _model.removeRow(i);

        initJTableForPriorityObject(arrObjectChoosed);
    }//GEN-LAST:event_jxBtnUpdateActionPerformed

    private void jxBtnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jxBtnDeleteActionPerformed
           int rs = JOptionPane.showOptionDialog(null, 
                        "Bạn có muốn xóa không!", 
                        "Câu hỏi", 
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.QUESTION_MESSAGE,
                        null,
                        null,
                        null);
        if(rs == 0)
        {
            if(isDeleteMoreStudent())
            {
                JOptionPane.showOptionDialog(null, 
                        "Xóa thành công!", 
                        "Thông báo", 
                        JOptionPane.YES_OPTION,
                        JOptionPane.INFORMATION_MESSAGE,
                        null,
                        null,
                        null);
                 //neu luu thanh cong
                this.jxtabDetails.m_isAdd = false;
                initControls();
                refreshDataInJTable();
            }
            else
                 JOptionPane.showMessageDialog(null, "Xóa thất bại. Vui lòng kiểm tra lại!", "Lỗi", JOptionPane.YES_OPTION);
        }
    }//GEN-LAST:event_jxBtnDeleteActionPerformed
    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox jChkSearchFast;
    private javax.swing.JCheckBox jChkSearchWithFacultyName;
    private javax.swing.JCheckBox jChkSearchWithFacultyName1;
    private javax.swing.JCheckBox jChkSearchWithFacultyName2;
    private javax.swing.JCheckBox jChkSearchWithFacultyName3;
    private javax.swing.JCheckBox jChkSearchWithMajorID;
    private javax.swing.JCheckBox jChkSearchWithMajorName;
    private org.jdesktop.swingx.JXLabel jLblNamNhapHoc;
    private javax.swing.JScrollPane jScrollPane;
    private javax.swing.JScrollPane jScrollPane1;
    private org.jdesktop.swingx.JXLabel jXLabel1;
    private org.jdesktop.swingx.JXLabel jXLabel10;
    private org.jdesktop.swingx.JXLabel jXLabel11;
    private org.jdesktop.swingx.JXLabel jXLabel13;
    private org.jdesktop.swingx.JXLabel jXLabel14;
    private org.jdesktop.swingx.JXLabel jXLabel3;
    private org.jdesktop.swingx.JXLabel jXLabel4;
    private org.jdesktop.swingx.JXLabel jXLabel5;
    private org.jdesktop.swingx.JXLabel jXLabel7;
    private org.jdesktop.swingx.JXLabel jXLabel8;
    private javax.swing.JPanel jpanChose;
    private javax.swing.JPanel jpanContent;
    private javax.swing.JPanel jpanFuntionalDetails;
    private javax.swing.JPanel jpanTableDetails;
    private org.jdesktop.swingx.JXButton jxBtnAdd;
    private org.jdesktop.swingx.JXButton jxBtnCancel;
    private org.jdesktop.swingx.JXButton jxBtnDelete;
    private org.jdesktop.swingx.JXButton jxBtnSave;
    private org.jdesktop.swingx.JXButton jxBtnUpdate;
    private org.jdesktop.swingx.JXComboBox jxCbGender;
    private org.jdesktop.swingx.JXComboBox jxCbMajor;
    private org.jdesktop.swingx.JXComboBox jxCbObject;
    private org.jdesktop.swingx.JXComboBox jxCbStatus;
    private org.jdesktop.swingx.JXDatePicker jxDpDateBirthday;
    private org.jdesktop.swingx.JXLabel jxLabFacultyID;
    private org.jdesktop.swingx.JXLabel jxLabNameOfFaculty;
    private org.jdesktop.swingx.JXSearchField jxSearchFaculty;
    private org.jdesktop.swingx.JXTable jxTbListObject;
    private org.jdesktop.swingx.JXTextField jxTxtDistrict;
    private org.jdesktop.swingx.JXTextField jxTxtFaculty;
    private org.jdesktop.swingx.JXTextField jxTxtInputYear;
    private org.jdesktop.swingx.JXTextField jxTxtNameOfStudent;
    private org.jdesktop.swingx.JXTextField jxTxtProvince;
    private org.jdesktop.swingx.JXTextField jxTxtStudentID;
    private org.jdesktop.swingx.JXButton jxbtnFindVisible;
    private org.jdesktop.swingx.JXPanel jxpanDetails;
    private org.jdesktop.swingx.JXPanel jxpanFindNavibar;
    private org.jdesktop.swingx.JXPanel jxpanHeader;
    private org.jdesktop.swingx.JXPanel jxpanInfo;
    private org.jdesktop.swingx.JXPanel jxpanInfoHeader;
    private org.jdesktop.swingx.JXPanel jxpanTitleHeader;
    private mnstudent.global.MyTable jxtabDetails;
    // End of variables declaration//GEN-END:variables
}
